home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / editors / me31111 / ue311cmd.zoo / cmd / emacs.rc < prev    next >
Encoding:
Text File  |  1992-09-07  |  6.3 KB  |  268 lines

  1. ;    EMACS.RC:    Standard micro Startup program
  2. ;            for MicroEMACS 3.9d and above
  3. ;            (C)opyright 1987 by Daniel M Lawrence
  4. ;            Last Update: 10/20/87
  5.  
  6. set $discmd FALSE
  7. write-message "[Setting up....]"
  8.  
  9. ; If you screen "SNOWS", comment this line
  10.     set $flicker "FALSE"
  11.  
  12. ; To use an IBM-PC EGA card, uncomment the following line
  13. ;    set $sres "EGA"
  14.  
  15. ;    Set Default Global modes
  16.  
  17. add-global-mode "white"
  18. add-global-mode "BLACK"
  19.  
  20. ; Time how long a matching fence is displayed. As it is machine-dependant,
  21. ; on a TT you might want to increase this value...
  22. set $tpause 300
  23.  
  24. set $timeflag TRUE
  25. ;bind-to-key meta-prefix `    ;for annoying keyboards with ` at the top left
  26.  
  27. ;    Toggle function key window display
  28.  
  29. ; Uncomment the following if you have a mv program and you want 
  30. ; backups of your files to be placed in $TMPDIR
  31.  
  32. store-procedure filebackup
  33. !if &exist $cfname
  34.     execute-program &cat &cat &cat "mv " $cfname " " &env TMPDIR
  35. !endif
  36. !endm
  37. set $writehook filebackup
  38.  
  39. store-procedure    toggle-fkeys
  40.     !if %rcfkeys
  41.         !goto rcfoff
  42.     !endif
  43.  
  44. ;    toggle function key window on
  45.     save-window
  46.     1 next-window
  47.     !if &sequal $cbufname "emacs.hlp"
  48.         delete-window
  49.     !endif
  50.     !if ¬ &sequal $cbufname "Function Keys"
  51.         1 split-current-window
  52.         1 select-buffer "Function Keys"
  53.         add-mode "red"
  54.         add-mode "YELLOW"
  55.         !force 5 resize-window
  56.         1 goto-line
  57.     !endif
  58.     set %rcfkeys TRUE
  59.     !force restore-window
  60.     !if &sequal $cbufname "Function Keys"
  61.         next-window
  62.     !endif
  63.     write-message "[Function key window ON]"
  64.     !return
  65.  
  66.     ;Toggle the function key window off
  67. *rcfoff
  68.     save-window
  69.     1 next-window
  70.     !if &sequal "Function Keys" $cbufname
  71.         delete-window
  72.     !endif
  73.     !force restore-window
  74.     write-message "[Function key window OFF]"
  75.     set %rcfkeys FALSE
  76. !endm
  77.  
  78. ;    Bring up Online-help system
  79.  
  80. store-procedure get-help
  81.     set $discmd FALSE
  82.     source ehelp.cmd
  83.     set $discmd TRUE
  84. !endm
  85.  
  86. ;    Load a new page
  87.  
  88. store-procedure get-page-loader
  89.     !if &seq &find newpage.cmd ""
  90.         write-message "[Can not find NEWPAGE.CMD]"
  91.         !return
  92.     !endif
  93. !force    execute-file newpage.cmd
  94. !endm
  95.  
  96. ;procedure to clean out the current page (which is nothing right now)
  97.  
  98. store-procedure    clean
  99.     ; nothing by default
  100. !endm
  101.  
  102. ;    Set up auto CMODE
  103.  
  104. store-procedure set-default-mode
  105.     set %rcstmp &right $cfname 4
  106.     set %rctmp &sin %rcstmp "."
  107.     !if &equ %rctmp 0
  108.         !return
  109.     !endif
  110.     set %rctmp &mid %rcstmp &add %rctmp 1 5
  111.     !if &or &seq &upp %rctmp "C" &seq &upp %rctmp "H"
  112.         add-mode "cmode"
  113.     !endif
  114.     !if &seq &upp %rctmp "CC"
  115.         add-mode "cmode"
  116.     !endif
  117.     !if &or &seq &upp %rctmp "CPP" &seq &upp %rctmp "HPP"
  118.         add-mode "cmode"
  119.     !endif
  120.     !if &or &seq &upp %rctmp "MSS" &seq &upp %rctmp "TEX"
  121.         add-mode "wrap"
  122.     !endif
  123. !endm
  124. set $readhook set-default-mode
  125.  
  126. ;    This function activates the function key window as
  127. ;    a legitimate place to call up function keys using the mouse
  128.  
  129. store-procedure mouse-clicks
  130.  
  131.     ;remember where we started, and do the mouse movement
  132.     save-window
  133.     !force mouse-move-down
  134.  
  135.     ;If not in the function key window... leave
  136.     !if ¬ &sequal $cbufname "Function Keys"
  137.         !return
  138.     !endif
  139.  
  140.     ;First pos is a screen reposition, let it through
  141.     !if &and &equ $xpos 0 &equ $ypos 0
  142.         restore-window
  143.         !return
  144.     !endif
  145.  
  146.     ;Find out what function key were gonna do
  147.     add-mode magic
  148.     2 forward-character
  149.     set %rctmp $search
  150.     !force search-reverse "[fF][0-9]"
  151.     !if &seq $status FALSE
  152.         delete-mode magic
  153.         set $search %rctmp
  154.         !return
  155.     !endif
  156.  
  157.     ;we are on the "f" or "F".  Get the function key type and number now
  158.     set $search %rctmp
  159.     set %fcase lower
  160.     !if &equ $curchar 70
  161.         set %fcase upper
  162.     !endif
  163.     1 forward-character
  164.     set %fnum &chr $curchar
  165.     1 forward-character
  166.     set %fnum &cat %fnum &chr $curchar
  167.     set %fnum &add %fnum 0
  168.     !if &equ %fnum 10
  169.         set %fnum "0"
  170.     !endif
  171.     set %fname &cat "FN" %fnum
  172.     !if &seq %fcase upper
  173.         set %fname &cat "S-" %fname
  174.     !endif
  175.  
  176.     ;save the function
  177.     set %rccmd &bind %fname
  178.     delete-mode MAGIC
  179.  
  180.     ;swallow the up-button
  181.     set %rctmp >c
  182.  
  183.     ;restore the window and exit
  184.     restore-window
  185.  
  186.     ;procedures don't need the square brackets
  187.     !if &seq &left %rccmd 1 "["
  188.         set %rccmd &mid %rccmd 2 &sub &len %rccmd 2
  189.         %rccmd
  190.         !return
  191.     !endif
  192.  
  193.     ;and then execute it
  194.     !force execute-named-command %rccmd
  195. !endm    
  196. macro-to-key mouse-clicks MSa
  197.  
  198. ; This is just a simple macro for sending mails. You need a sendmail
  199. ; and you have to set its options right in mail.
  200. store-procedure mail
  201.     execute-file d:\lib\me3.11\cmd\mail
  202. !endm
  203.     macro-to-key mail M-S
  204.  
  205. ;    ***** Rebind the Function key group
  206.  
  207. bind-to-key search-forward        FN1
  208. bind-to-key search-reverse        FN2
  209. bind-to-key hunt-forward        FN3
  210. bind-to-key hunt-backward        FN4
  211. macro-to-key toggle-fkeys        FN5
  212. macro-to-key get-help            FN6
  213. bind-to-key next-window            FN7
  214. macro-to-key get-page-loader        FN8
  215. bind-to-key save-file            FN9
  216. bind-to-key exit-emacs            FN0
  217.  
  218. bind-to-key execute-macro-10        S-FN1
  219. bind-to-key execute-macro-11        S-FN2
  220. bind-to-key execute-macro-12        S-FN3
  221. bind-to-key execute-macro-13        S-FN4
  222. bind-to-key execute-macro-14        S-FN5
  223. bind-to-key execute-macro-15        S-FN6
  224. bind-to-key execute-macro-16        S-FN7
  225. bind-to-key execute-macro-17        S-FN8
  226. bind-to-key execute-macro-18        S-FN9
  227. bind-to-key execute-macro-19        S-FN0
  228.  
  229. ;    bring up the function key window
  230.  
  231.     1 split-current-window
  232.     select-buffer "Function Keys"
  233.     set $cbflags 1
  234.     insert-string "f1 search-> f2 <-search ף    MicroEMACS:  Text Editor~n"
  235.     insert-string "f3 hunt->   f4 <-hunt   ף ~n"
  236.     set %rctmp &sin $osystem "/"
  237.     !if &equ %rctmp 0
  238.         !goto nofsel
  239.     !endif
  240.     set %rctmp &mid $osystem %rctmp 6
  241.     !if &or &seq %rctmp "/ AES " &seq %rctmp "/ ST52" 
  242.  
  243. store-procedure toggle-fsel
  244.     set $gflags &bxor $gflags 4
  245.     !if &equ &band $gflags 4 4
  246.         print "Fileselector turned ON."
  247.     !else
  248.         print "Fileselector turned OFF."
  249.     !endif
  250. !endm
  251.  
  252.     insert-string "f5 fkeys    f6 filesel. ף  Available function key Pages include:~n"
  253.     macro-to-key toggle-fsel        FN6
  254.     !else
  255. *nofsel
  256.     insert-string "f5 fkeys    f6 help     ף  Available function key Pages include:~n"
  257.         !endif
  258.     insert-string "f7 nxt wind f8 pg[    ] ף    Word  Box  Emacs  Pascal  C  cObal Lisp~n"
  259.     insert-string "f9 save     f10 exit    ף  [use the f8 key to load Pages]~n"
  260.     unmark-buffer
  261.     delete-window
  262.     set %rcfkeys FALSE
  263.  
  264. ;        Bind keypad, help and delete keys on ST
  265. !force    execute-file stkeypad.cmd
  266. !force    execute-file &cat &cat &env HOME "\" "emacs.hrc"
  267.     set $discmd TRUE
  268.